/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn;

import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.engine.FreemarkerTemplateEngine;

import java.util.Collections;

/**
 * <p></p>
 * <p>Powered by webrx On 2023-04-27 09:10:08</p>
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class Demo {
    public static void main(String[] args) {

        //D:/com/baomidou/controller entity mapper service
        //FastAutoGenerator.create("jdbc:mysql:/erp","root","root")
        //        .templateEngine(new FreemarkerTemplateEngine())
        //        .execute();

        FastAutoGenerator.create("jdbc:mysql:/erp","root","root")
                .globalConfig(e->{
                    e.author("webrx").outputDir("D:\\mp\\ch05generator\\src\\main\\java\\");
                })
                .packageConfig(e->{
                    e.parent("cn.webrx").moduleName("erp")
                            .pathInfo(Collections
                                    .singletonMap(OutputFile.xml,"D:\\mp\\ch05generator\\src\\main\\resources\\mapper\\"));
                })
                .strategyConfig(e->e.addInclude().addTablePrefix("t_","s_","w_","wx_","sys_"))
                .templateEngine(new FreemarkerTemplateEngine())
                .execute();


    }
}
